import { App, createVNode, render, VNode } from 'vue'
import Loading from './index.vue'

// 将组件封装成插件

export default {
    install(app:App) {
        const vNode:VNode = createVNode(Loading)
        render(vNode, document.body)
        app.config.globalProperties.$loading = {
            show: vNode.component?.exposed?.show,
            hide: vNode.component?.exposed?.hide,
        }
    },
}